package com.ewing.busi.api.pay.constants;

import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;

/**
 * 客户订单状态
 */
public enum PayWay {


  WCPAY("0", "微信支付"),

  ALIPAY("1", "支付宝");


  private String value;
  private String msg;

  PayWay(String value, String msg) {
    this.value = value;
    this.msg = msg;
  }

  public String getValue() {
    return value;
  }

  public String getMsg() {
    return msg;
  }

  public static PayWay getByValue(String value) {
    if (StringUtils.isEmpty(value)) {
      return null;
    }

    for (PayWay payWay : PayWay.values()) {
      if (ObjectUtils.equals(payWay.value, value)) {
        return payWay;
      }
    }

    return null;
  }
}
